package qa.ui;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.CardLayout;

public class Screen extends JFrame {

	public static final String WELCOME = "welcome";
	public static final String LoginScreen = "loginScreen";
	public static final String MenuScreen = "menuScreen";
	public static final String BalanceInformation = "balanceInformation";
	public static final String WithdrawlMenu = "withdrawlMenu";
	public static final String DepositCash = "depositCash";
	public static final String Exit = "exit";
	public static final String RESULT = "result";
	
	private JPanel contentPane;
	
	private Welcome welcome;
	private LoginScreen loginScreen;
	private MenuScreen menuScreen;
	private BalanceInformation balanceInformation;
	private WithdrawlMenu withdrawlMenu;
	private DepositCash depositCash;
	private Exit exit;
	private Result result;
	private CardLayout cardLayout;
	
	public Screen() {	
		super("Property of Esbjerg Lufthavn");
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		setResizable(false);
		contentPane.setLayout(new CardLayout(0, 0));
		
		welcome = new Welcome();
		contentPane.add(welcome, "welcome");
		
		loginScreen = new LoginScreen();
		contentPane.add(loginScreen, "loginScreen");
		
		menuScreen = new MenuScreen();
		contentPane.add(menuScreen, "menuScreen");
		
		balanceInformation = new BalanceInformation ();
		contentPane.add(balanceInformation, "balanceInformation");
		
		withdrawlMenu= new WithdrawlMenu ();
		contentPane.add(withdrawlMenu, "withdrawlMenu");
		
		depositCash= new DepositCash();
		contentPane.add(depositCash, "depositCash");
		
		exit = new Exit();
		contentPane.add(exit, "exit");
		
		result = new Result();
		contentPane.add(result, "name_15738661078262");
		
		cardLayout = (CardLayout) getContentPane().getLayout();
	}
	
	public Welcome getWelcome() {
		return welcome;
	}

	public LoginScreen getLoginScreen() {
		return loginScreen;
	}

	public MenuScreen getMenuScreen() {
		return menuScreen;
	}

	public BalanceInformation getBalanceInformation(){
		return balanceInformation;
		
	}
	public WithdrawlMenu getWithdrawlMenu(){
		return withdrawlMenu;
	}
	
	public DepositCash getDepositCash(){
		return depositCash;
		
	}
	
	public Exit getExit(){
		return exit;
	}
	public Result getResult() {
		return result;
	}

	public void show(String card) {
		cardLayout.show(this.getContentPane(), card);
	}

}

